// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

/**
 * Enum for lane types.
 */
enum class FWorldLaneType
{
	None,
	Driving,
	Stop,
	Shoulder,
	Biking,
	Sidewalk,
	Border,
	Restricted,
	Parking,
	Bidirectional,
	Median,
	Special1,
	Special2,
	Special3,
	RoadWorks,
	Tram,
	Rail,
	Entry,
	Exit,
	OffRamp,
	OnRamp
};

inline FWorldLaneType FWorldLaneTypeFromJson(const json& j)
{
	if (j == "none")			return FWorldLaneType::None;
	if (j == "driving")			return FWorldLaneType::Driving;
	if (j == "stop")			return FWorldLaneType::Stop;
	if (j == "shoulder")		return FWorldLaneType::Shoulder;
	if (j == "biking")			return FWorldLaneType::Biking;
	if (j == "sidewalk")		return FWorldLaneType::Sidewalk;
	if (j == "border")			return FWorldLaneType::Border;
	if (j == "restricted")		return FWorldLaneType::Restricted;
	if (j == "parking")			return FWorldLaneType::Parking;
	if (j == "bidirectional")	return FWorldLaneType::Bidirectional;
	if (j == "median")			return FWorldLaneType::Median;
	if (j == "special1")		return FWorldLaneType::Special1;
	if (j == "special2")		return FWorldLaneType::Special2;
	if (j == "special3")		return FWorldLaneType::Special3;
	if (j == "roadWorks")		return FWorldLaneType::RoadWorks;
	if (j == "tram")			return FWorldLaneType::Tram;
	if (j == "rail")			return FWorldLaneType::Rail;
	if (j == "entry")			return FWorldLaneType::Entry;
	if (j == "exit")			return FWorldLaneType::Exit;
	if (j == "offRamp")			return FWorldLaneType::OffRamp;
	if (j == "onRamp")			return FWorldLaneType::OnRamp;
	return FWorldLaneType::None;
}

inline json FWorldLaneTypeToJson(FWorldLaneType p)
{
	if (p == FWorldLaneType::None)			return "none";
	if (p == FWorldLaneType::Driving)		return "driving";
	if (p == FWorldLaneType::Stop)			return "stop";
	if (p == FWorldLaneType::Shoulder)		return "shoulder";
	if (p == FWorldLaneType::Biking)		return "biking";
	if (p == FWorldLaneType::Sidewalk)		return "sidewalk";
	if (p == FWorldLaneType::Border)		return "border";
	if (p == FWorldLaneType::Restricted)	return "restricted";
	if (p == FWorldLaneType::Parking)		return "parking";
	if (p == FWorldLaneType::Bidirectional)	return "bidirectional";
	if (p == FWorldLaneType::Median)		return "median";
	if (p == FWorldLaneType::Special1)		return "special1";
	if (p == FWorldLaneType::Special2)		return "special2";
	if (p == FWorldLaneType::Special3)		return "special3";
	if (p == FWorldLaneType::RoadWorks)		return "roadWorks";
	if (p == FWorldLaneType::Tram)			return "tram";
	if (p == FWorldLaneType::Rail)			return "rail";
	if (p == FWorldLaneType::Entry)			return "entry";
	if (p == FWorldLaneType::Exit)			return "exit";
	if (p == FWorldLaneType::OffRamp)		return "offRamp";
	if (p == FWorldLaneType::OnRamp)		return "onRamp";
	return "none";
}

inline void from_json(const json& j, FWorldLaneType& p)
{
	p = FWorldLaneTypeFromJson(j);
}

inline void to_json(json& j, const FWorldLaneType& p)
{
	j = FWorldLaneTypeToJson(p);
}
